package com.ssqdx.mapper;

import com.ssqdx.pojo.User;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.List;

/**
 * @author asus
 * @date 2021/6/8 16:20:40
 * @description
 */
public class UserMapperImpl implements UserMapper {
    //我们所有的操作，都是用sqlsession来执行，在原来，现在都使用SqlSessionTemplate;
    private SqlSessionTemplate sqlSession;
    public void  setSqlSession(SqlSessionTemplate sqlSession){
            this.sqlSession=sqlSession;
    }
    public List<User> selectUser() {
        UserMapper mapper = sqlSession.getMapper(UserMapper.class);
        return mapper.selectUser();
    }
}
